#include <cstdio>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <cctype>
#include <set>
#define int long long
#define pii std::pair <int, int>
#define mkp std::make_pair
template <typename T = int> T read()
{
	T x = 0, f = 1; char c = getchar();
	for(; !isdigit(c); c = getchar()) if(c == '-') f = -1;
	for(;  isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48);
	return x * f;
}

template <typename T> void ckmax(T &x, T y) { x = x > y ? x : y; }
template <typename T> void ckmin(T &x, T y) { x = x < y ? x : y; }

#define N 200010
int n, S;
int x_[N], y_[N];
std::vector <int> nvec[N];
int mnhp[N], mx, base;
int dp[N];
#define lson k << 1
#define rson k << 1 | 1
std::deque <pii> vec[N << 2];

void rebuild(int k, pii v)
{
	if(!vec[k].empty() && vec[k].begin()->first == v.first) { ckmin(vec[k].front().second, v.second); return; }
	while(vec[k].size() > 1 && (__int128)(vec[k].begin()->second - v.second) * ((++vec[k].begin())->first - v.first) >= (__int128)((++vec[k].begin())->second - v.second) * (vec[k].begin()->first - v.first))
		vec[k].pop_front();
	vec[k].push_front(v);
}

int calc(pii v, int k)
{
	return v.second + k * v.first;
}

void ins(int k, int l, int r, int q, pii z)
{
	rebuild(k, z);
	if(l == r) return;
	int mid = (l + r) >> 1;
	q <= mid ? ins(lson, l, mid, q, z) : ins(rson, mid + 1, r, q, z);
}

int query(int k, int t)
{
	if(vec[k].empty()) return 0x3f3f3f3f3f3f3f3fll;
	while(vec[k].size() > 1 && calc(*vec[k].rbegin(), t) >= calc(*(++vec[k].rbegin()), t)) vec[k].pop_back();
	return calc(*vec[k].rbegin(), t);
}

int query(int k, int l, int r, int ql, int qr, int t)
{
	if(ql <= l && r <= qr) return query(k, t);
	int mid = (l + r) >> 1, res = 0x3f3f3f3f3f3f3f3fll;
	if(ql <= mid) ckmin(res, query(lson, l, mid, ql, qr, t));
	if(mid < qr)  ckmin(res, query(rson, mid + 1, r, ql, qr, t));
	return res;
}
int mxhp;
void calc(int i)
{
	if(i == n) { dp[i] = 0; return; }
	dp[i] = 0x3f3f3f3f3f3f3f3fll;
	for(int l = 1, r = i; l <= mxhp; l = r + 1, r = r + i)
	{
		ckmin(dp[i], query(1, 1, mxhp, l, std::min(r, mxhp), r / i - 1));
	}
}
signed main()
{
	freopen("xinyue.in", "r", stdin);
	freopen("xinyue.out", "w", stdout);
	memset(mnhp, 0x3f, sizeof(mnhp));
	n = read(), S = read(); mx = S;
	for(int i = 1; i <= n; i++) x_[i] = read(), y_[i] = read(), ckmax(mx, x_[i]), ckmax(mxhp, y_[i]);
	for(int i = 1; i <= n; i++) base += (y_[i] - 1) / mx * x_[i];
	for(int i = 1; i <= n; i++) nvec[x_[i]].push_back(y_[i]);
	if(mx == S) { printf("%lld\n", base); return 0; }
	n = mx;
	for(int i = n; i >= S; i--) 
	{
		calc(i);
		if(dp[i] == 0x3f3f3f3f3f3f3f3fll) break;
		std::sort(nvec[i].begin(), nvec[i].end());
		bool flg = 0;
		for(int p : nvec[i])
		{
			ins(1, 1, mxhp, p, mkp(i, dp[i] - (p - 1) / mx * i));
			flg = 1;
		}
	}
	printf("%lld\n", dp[S] + base);
}
